Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT WIP] innovation typed table block #5200

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

johnnyporkchops
Copy link
Contributor

@johnnyporkchops johnnyporkchops commented May 6, 2022

Summary (required)

  • Resolves #issue_number

Partially addresses issue #4258. We cannot control column widths in the Wagtail table_block widget that is used to create the table in the example in the issue (audit documents table). This innovation sprint draft PR customizes the new Wagtail typed_table_block to allow users to choose certain preset table column percentage widths. I am not sure how useful this would be in its present form.

In regards to the undesirable column width distribution of the table in the example (audit documents table), One way we could solve this by creating another custom table block (not using typed_table_block) that allows the editor to choose to set the table width with a CSS class to width: auto. This makes the first column wider to accommodate the text like the "After" screenshot. Also see #4258 (comment)

We should avoid setting table-layout:auto , overriding our global CSS setting of table-layout: fixed because table-layouot: fixed is the more performant and auto might result in a Lighthouse performance audit hit ( Need to confirm this with a test). Also should do more research to determine if CSS width:auto (or unset) is a performance issue. Please note that the table html attribute width=" " is deprecated.

Note: The failed build on this draft PR is just a FLAKE8 error on blocks,py that can be resolved easily

Required reviewers

None yet as this is a draft PR

Impacted areas of the application

modified: fec/fec/settings/base.py
modified: fec/home/blocks.py
new file: fec/home/templates/blocks/typed_table_block.html
new migrations: Important note: There are a few migration files created while developing this, however if this was to be merged we should start with a fresh database dump locally and create a single migration for this.

Screenshots

choose_preset_column_width

Related PRs

Related PRs against other branches:

branch PR
fix/other_pr link
feature/other_pr link

How to test

(Include any information that may be helpful to the reviewer(s). This might include links to sample pages to test or any local environmental setup that is unusual such as environment variable (never credentials), API version to point to, etc)

System architecture updates (if applicable)

(If this pull request changes our current system diagram, include a description of those changes here and create a new ticket to update the system diagram)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants